//
//  PSScorer.h
//  PrefCore
//
//  Created by Sergey on 2/28/14.
//  Copyright (c) 2014 Play-on-smart. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "PSGame.h"

@class PSCalculator;
@class PSMisereScorer;
@class PSPassingScorer;
@class PSPassingRostovScorer;
@class PSTrickingScorer;
@class PSTrickingTenScorer;
@class PSTrickingHalfWhistScorer;
@class PSTrickingTwoPassesScorer;
@class PSTrickingWithoutThreeScorer;

/// Abstract base class for scorers.
@interface PSScorer : NSObject

+(void)balanceGame:(PSGame*)game withSettings:(PSGameSettings*)settings andCalculator:(PSCalculator*)calc;

-(void)scoreGame:(PSGame*)game withSettings:(PSGameSettings*)settings andCalculator:(PSCalculator*)calc;

/// Write corresponding score (passing, misere, etc.)
-(void)updateGame:(PSGame*)game withSettings:(PSGameSettings*)settings andCalculator:(PSCalculator*)calc;

/// Update corresponding statistics (passing, misere, etc.)
-(void)updateStatisticsOfGame:(PSGame*)game;

+(PSMisereScorer*)misereScorer;

+(PSPassingScorer*)passingScorer;

+(PSPassingRostovScorer*)passingRostovScorer;

+(PSTrickingScorer*)trickingScorer;

+(PSTrickingTenScorer*)trickingTenScorer;

+(PSTrickingHalfWhistScorer*)trickingHalfWhistScorer;

+(PSTrickingTwoPassesScorer*)trickingTwoPassesScorer;

+(PSTrickingWithoutThreeScorer*)trickingWithoutThreeScorer;

@end

/// Scorer for misere.
@interface PSMisereScorer : PSScorer

-(void)updateGame:(PSGame*)game withSettings:(PSGameSettings*)settings andCalculator:(PSCalculator*)calc;

-(void)updateStatisticsOfGame:(PSGame*)game;

@end

/// Base class for passing scorers.
@interface PSPassingScorer : PSScorer

+(PSScoreValue)trickCostsForGame:(PSGame*)game withSettings:(PSGameSettings*)settings;

-(void)updateGame:(PSGame*)game withSettings:(PSGameSettings*)settings andCalculator:(PSCalculator*)calc;

-(void)updateStatisticsOfGame:(PSGame*)game;

@end

/// Passing scorer for Rostov.
@interface PSPassingRostovScorer : PSPassingScorer

-(void)updateGame:(PSGame*)game withSettings:(PSGameSettings*)settings andCalculator:(PSCalculator*)calc;

@end

/// Tricking scorer.
@interface PSTrickingScorer : PSScorer

-(void)updateGame:(PSGame*)game withSettings:(PSGameSettings*)settings andCalculator:(PSCalculator*)calc;

-(void)updateStatisticsOfGame:(PSGame*)game;

@end

/// Tricking scorer for taking ten tricks.
@interface PSTrickingTenScorer : PSScorer

-(void)updateGame:(PSGame*)game withSettings:(PSGameSettings*)settings andCalculator:(PSCalculator*)calc;

-(void)updateStatisticsOfGame:(PSGame*)game;

@end

/// Scorer for taking half whist in a tricking game.
@interface PSTrickingHalfWhistScorer : PSScorer

-(void)updateGame:(PSGame*)game withSettings:(PSGameSettings*)settings andCalculator:(PSCalculator*)calc;

-(void)updateStatisticsOfGame:(PSGame*)game;

@end

/// Scorer for both opponents pass in a tricking game.
@interface PSTrickingTwoPassesScorer : PSScorer

-(void)updateGame:(PSGame*)game withSettings:(PSGameSettings*)settings andCalculator:(PSCalculator*)calc;

-(void)updateStatisticsOfGame:(PSGame*)game;

@end

/// Scorer for exiting the game without three.
@interface PSTrickingWithoutThreeScorer : PSScorer

-(void)updateGame:(PSGame*)game withSettings:(PSGameSettings*)settings andCalculator:(PSCalculator*)calc;

-(void)updateStatisticsOfGame:(PSGame*)game;

@end
